package com.thering.movie_servers.movies.controller;

import com.thering.movie_servers.movies.pojo.MovieType;
import com.thering.movie_servers.movies.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * author: the_ring
 * date: 2022/6/7
 * function: TypeController
 */
@RestController
@CrossOrigin()
public class TypeController {

    @Autowired
    TypeService typeService;

    @GetMapping("/types")
    public List<MovieType> getTypes() {
        return typeService.getTypes();
    }
}
